<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8"  name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,initial-scale=1,user-scalable=no">
	 <meta http-equiv="X-UA-Compatible" content="IE=edge">
	<link rel="stylesheet" type="text/css" href="../css/denglu.css">
	<script src="/js/jquery-3.1.0.js"></script>
	<title>登录</title>
</head>
<!--   <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>我的生活</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <link rel="shortcut icon" href="/favicon.ico">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
    <link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm-extend.min.css">

  </head> -->
<body>

<div class="content">
	<div class="head">
		<a href="index.html">
			<div class="backimg floatleft">
				<
				<div class="clear"></div>
			</div>
		</a>
		<div class="textstyle1-floatleft">
			登录
			<div class="clear"></div>
		</div>
		<a href=http://www.baidu.com>
			<div class="backimg floatright">
				&nbsp;
				<div class="clear"></div>
			</div>
		</a>
	</div>

	<form action="denglu.html" method="post">
		<div class="content">
			<div id="telphone" class="telphone">
				<div class="telphone-left">
					<div class="shoujipicture">
						<img  class="phone" src="../images/phone.png">
					</div>
					<input  class="name1" type="text" placeholder="用户名" id="username" />
				</div>
				<div class="huoquyanzheng" herf="http://www.baidu.com">
					<div  class="huoquyanzheng-yanzheng">忘记密码?</div>
				</div>
				<div class="clear"></div>
			</div>

			<div id="yanzhengma">
				<div class="yaoshipicture">
					<img  class="key" src="../images/key.png">
				</div>

				<input class="name1" type="text" placeholder="输入密码" id="password" >
				<div class="clear"></div>
			</div>



			<div id="xiaozi">
				<div class="agreement-left">绑定账号行为表示您同意</div>
				<a href=http://www.baidu.com >
					<div class="agreement-right" >《隐私协议》</div>
				</a>
			</div>
			<div id="text01">请登录</div>

			<input class="button" type="button" name="" value="登录" id="submit" />

		</div>

	</form>
</div>

    <script type='text/javascript' src='http://g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm-extend.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='../js/utils.js'></script>

<!-- <script>

	$("#submit").click(function () {

		var username=$("#username").val();
		var password= $("#password").val();
		//var phonenumber=$("#phonenumber").val();

		var info= {
			username: username,
			password: password,
			//phonenumber: phonenumber,
		}

 		$.ajax({
			url:"/user/denglu.do",
			method:"POST",
			data:info,
			dataType: "json",

			success: function (result)
			{
//				$('#username').val(result.username);
//
//    			$('#password').val(result.password);
  			//$('#phonenumber').val(result.phonenumber);
			//	alert(result);


				if(result=="1")
				{
					location.href ="index.html";
				}
				else
				{
					$("#text01").html("手机号或者验证码错误");
				}
			}



		});




	})
</script> -->




<script>
    $(function () {
        
        $('#submit').on('click', function () {
            var username = $('#username').val();
            var password = $('#password').val();



            AjaxIO.post("/login",
                                 {loginId: username, password: password},
                                     function (result) {
                                        //alert(result.data.a);
                                    if (result.data.token&&result.data.a==1) {                            
                                        localStorage.setItem("token",result.data.token);
                                        //alert("1");
                                        location.href = "index.html";
                                    }
                                    else
                                    {
                                    	$("#text01").html("手机号或者验证码错误");
                                    }
            });

        });


    });
</script>
</body>
</html>